home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / lastcall.dxr / 00180_Slot machine.ls < prev    next >
Encoding:
Text File  |  2000-03-27  |  2.4 KB  |  112 lines

  1. on exitFrame
  2.   global gPlayerTipsThisLevel, gPlayedSlots, gPlayerTips, gBonusCharacters
  3.   if gPlayerTipsThisLevel <= 0 then
  4.     if voidp(gPlayedSlots) then
  5.       gPlayerTips = 0
  6.       regTip(50)
  7.       gPlayedSlots = 1
  8.     end if
  9.   end if
  10.   if soundBusy(3) then
  11.     go(the frame)
  12.     exit
  13.   end if
  14.   done = 1
  15.   patron = []
  16.   ing = []
  17.   repeat with Y = 1 to 3
  18.     X = gBonusCharacters[Y]
  19.     if sprite(X).pStatus <> #done then
  20.       done = 0
  21.       exit repeat
  22.       next repeat
  23.     end if
  24.     patron[Y] = sprite(X).pCharCode
  25.     ing[Y] = sprite(X).pIngredient
  26.   end repeat
  27.   if not done then
  28.     go(the frame)
  29.     exit
  30.   end if
  31.   matchPatrons = 0
  32.   if patron[1] = patron[2] then
  33.     matchPatrons = matchPatrons + 1
  34.   end if
  35.   if patron[1] = patron[3] then
  36.     matchPatrons = matchPatrons + 1
  37.   end if
  38.   if patron[2] = patron[3] then
  39.     matchPatrons = matchPatrons + 1
  40.   end if
  41.   matchIngredients = 0
  42.   matchBoth = 0
  43.   if ing[1] = ing[2] then
  44.     matchIngredients = matchIngredients + 1
  45.     if patron[1] = patron[2] then
  46.       matchBoth = matchBoth + 1
  47.     end if
  48.   end if
  49.   if ing[1] = ing[3] then
  50.     matchIngredients = matchIngredients + 1
  51.     if patron[1] = patron[3] then
  52.       matchBoth = matchBoth + 1
  53.     end if
  54.   end if
  55.   if ing[2] = ing[3] then
  56.     matchIngredients = matchIngredients + 1
  57.     if patron[2] = patron[3] then
  58.       matchBoth = matchBoth + 1
  59.     end if
  60.   end if
  61.   put patron
  62.   put ing
  63.   if matchBoth = 3 then
  64.     coins = 500
  65.   else
  66.     if matchPatrons = 3 then
  67.       if matchIngredients = 1 then
  68.         coins = 100
  69.       else
  70.         coins = 75
  71.       end if
  72.     else
  73.       if matchBoth = 1 then
  74.         if matchIngredients = 3 then
  75.           coins = 75
  76.         else
  77.           coins = 50
  78.         end if
  79.       else
  80.         if matchIngredients = 3 then
  81.           coins = 35
  82.         else
  83.           if matchPatrons = 1 then
  84.             if matchIngredients = 1 then
  85.               coins = 15
  86.             else
  87.               coins = 8
  88.             end if
  89.           else
  90.             if matchIngredients = 1 then
  91.               coins = 6
  92.             else
  93.               coins = 0
  94.             end if
  95.           end if
  96.         end if
  97.       end if
  98.     end if
  99.   end if
  100.   put "MatchBoth" && matchBoth
  101.   put "MatchIngredients" && matchIngredients
  102.   put "matchPatrons" && matchPatrons
  103.   put "coins" && coins
  104.   if coins > 0 then
  105.     regTip(coins)
  106.   else
  107.     soundFX2("bad_drink", 0, 0)
  108.   end if
  109.   sprite(9).pStatus = #new
  110.   go(the frame)
  111. end
  112.